package main

import (
	"fmt"
	"net"
	"net/url"
	"strconv"
)

func main() {
	host := "127.0.0.1"
	port := 8080
	u, _ := url.Parse("http://xxx.com/api/v1/get")
	u.Host = net.JoinHostPort(host, strconv.Itoa(port))
	// http://127.0.0.1:8080/api/v1/get
	fmt.Println(u.String())
}
